package com.itr.beans;

import com.sun.xml.internal.bind.marshaller.NamespacePrefixMapper;

/**
 * @author rohit.kumar
 *
 */
public class ITRNameSpaceMapper extends NamespacePrefixMapper {

	private static final String ITR_PREFIX = "ITRETURN";
	private static final String ITR_NAMESPACE = "http://incometaxindiaefiling.gov.in/main";
	
	private static final String ITRFORM_PFX = "ITRForm";
	private static final String ITRFORM_NS = "http://incometaxindiaefiling.gov.in/master";
	
	private static final String ITR1FORM_PFX = "ITR1FORM";
	private static final String ITR1FORM_NS = "http://incometaxindiaefiling.gov.in/ITR1";
	
	@Override
	public String getPreferredPrefix(String namespaceUri, String suggestion, boolean requirePrefix) {
		String returnPrefix = "";
		if(namespaceUri.equalsIgnoreCase(ITR_NAMESPACE))
			returnPrefix = ITR_PREFIX;
		else if(namespaceUri.equalsIgnoreCase(ITRFORM_NS))
			returnPrefix = ITRFORM_PFX;
		else if(namespaceUri.equalsIgnoreCase(ITR1FORM_NS))
			returnPrefix = ITR1FORM_PFX;
		else 
			returnPrefix = ITR_PREFIX;
		return returnPrefix;
	}
	
	 @Override
	    public String[] getPreDeclaredNamespaceUris() {
	        return new String[] { ITR_NAMESPACE, ITRFORM_NS, ITR1FORM_NS};
	    }

}
